// JavaScript Document
function $$(id) {
    return document.getElementById(id);
}

//页面加载时调用的函数
function pageload() {
    var strName = localStorage.getItem("keyName");
    var strPass = localStorage.getItem("keyPass");
    var strTest = localStorage.getItem("keytest");
    if (strName) {
        $$("account_name").value = strName;
    }
    if (strPass) {
        $$("Pass").value = strPass;
    }
    if(strTest){
        $$("test").value = strTest;

    }
}

//点击“登录”按钮后调用的函数
function login() {
    var strName = $$("account_name").value;
    var strPass = $$("Pass").value;
    var strTest = $$("test").value;
    localStorage.setItem("keyName", strName);

    if (strName == "" ) {

        return false;

    }if(strPass == ""){
        return false;
    }
    if(strTest == ""){
        return false;
    }

    if ($$("savepass").checked) {
        localStorage.setItem("keyPass", strPass);

    } else {
        localStorage.removeItem("keyPass");
    }

    $$("spnStatus").className = "status";

       $$("spnStatus").innerHTML = "登录成功";

}
